package com.cac.demo.newCode.sorting.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cac.demo.newCode.materialStorage.vo.InventoryDetailVO;
import com.cac.demo.newCode.sorting.dto.SortingTaskDTO;
import com.cac.demo.newCode.sorting.entity.MsAoMatchInfo;
import com.cac.demo.newCode.sorting.entity.MsAssginWorkbintoolRel;
import com.cac.demo.newCode.sorting.vo.MaterialSortedVO;
import com.cac.demo.newCode.sorting.vo.SortingTaskVO;
import com.cac.demo.newCode.sorting.vo.WorkBinMaterialVO;
import com.cac.demo.newCode.sorting.vo.WorkBinVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface SortingTaskMapper {
    List<SortingTaskDTO> getTray(@Param("IP")String IP );

    List<SortingTaskDTO> getWorkBinCodes(@Param("toolCode")String toolCode);

    int insertToolGkLog(@Param("ip")String ip, @Param("toolCode")String toolCode,@Param("packageCode")String packageCode);

    int insertBigWorkbinGkLog(@Param("ip")String ip, @Param("toolCode")String toolCode);

    int insertSuppleGkLog(@Param("ip")String ip, @Param("toolCode")String toolCode);

    int insertWorkbinGkLog(@Param("ip")String ip, @Param("workbinCode")String workbinCode,@Param("packageCode")String packageCode);

    String findStartCode(@Param("IP")String IP, @Param("boxType")String boxType);
    SortingTaskDTO searchLocation(@Param("IP")String IP);
    int delGkLog(@Param("dto")SortingTaskDTO sortingTaskDTO);
    int deleteBigLog(@Param("dto")SortingTaskDTO sortingTaskDTO);
    int delGkLogSupple(@Param("dto")SortingTaskDTO sortingTaskDTO);
    List<SortingTaskVO> queryReplaceTool(@Param("dto") SortingTaskDTO sortingTaskDTO);

    List<WorkBinVO> viewWorkBin(String ip);

    IPage<MaterialSortedVO> materialSorted(IPage<?> page, @Param("dto")SortingTaskDTO sortingTaskDTO);


    List<MaterialSortedVO> scanConfirmMaterial(@Param("dto")SortingTaskDTO sortingTaskDTO);

    IPage<MaterialSortedVO> scanConfirmMaterialPage(IPage<?> page, @Param("dto")SortingTaskDTO sortingTaskDTO);

    int saveAssignWorkbinToolRel();

    String getToolCodeByPackage(@Param("pojo") MsAssginWorkbintoolRel msAssginWorkbintoolRel);
    String getToolCodeByRule(@Param("pojo")MsAssginWorkbintoolRel msAssginWorkbintoolRel);

    List<SortingTaskDTO> searchToolCode(String ip);

    int saveNewAoMatchInfo(@Param("dto")SortingTaskDTO sortingTaskDTO);

    int saveAssignWorkbinToolRelByMatchInfoId(@Param("dto")SortingTaskDTO sortingTaskDTO);

    int updatePreMatchInfo(SortingTaskDTO sortingTaskDTO);

    int updateAssginWorkbinToolRelStatus(SortingTaskDTO sortingTaskDTO);

    List<WorkBinMaterialVO> SameDrawingMaterial(SortingTaskDTO sortingTaskDTO);

    IPage<MsAoMatchInfo> getMaterial(IPage<?> page,@Param("dto")SortingTaskDTO sortingTaskDTO);

    List<SortingTaskDTO> getCurrentTool(@Param("consoleIp")String consoleIp,@Param("toolCodes")List<String> toolCodes,@Param("packageIds")List<String> packageIds);
    List<SortingTaskDTO> getCurrentWorkBin(@Param("consoleIp")String consoleIp,@Param("workbinCodes")List<String> workbinCodes,@Param("packageIds")List<String> packageIds);

    List<SortingTaskDTO> getWaitWorkBin(@Param("consoleIp")String consoleIp,@Param("workbinCodes")List<String> workbinCodes,@Param("packageIds")List<String> packageIds);
    List<SortingTaskDTO> getWaitTool(@Param("consoleIp")String consoleIp,@Param("toolCodes")List<String> toolCodes,@Param("packageIds")List<String> packageIds);
}
